<?php

namespace addons\alioss\service;

use app\AppService;
use Flc\Alidayu\Client;
use Flc\Alidayu\App;
use Flc\Alidayu\Requests\AlibabaAliqinFcSmsNumSend;

class SmsService extends AppService
{
    /**
     * @desc 发送短信
     * @param $param
     */
    public static function send($param)
    {
        $config = [
            'app_key'    => '*****',
            'app_secret' => '************',
            // 'sandbox'    => true,  // 是否为沙箱环境，默认false
        ];

        $client = new Client(new App($config));
        $req    = new AlibabaAliqinFcSmsNumSend;

        $req->setRecNum('13312311231')
            ->setSmsParam([
                'number' => rand(100000, 999999)
            ])
            ->setSmsFreeSignName('叶子坑')
            ->setSmsTemplateCode('SMS_15105357');

        $resp = $client->execute($req);
        return false;
    }
}